﻿@model TopicModel

@{
    var showTour = ViewBag.ShowTour ?? false;

    const string hideInfoBlockAttributeName = "TopicDetailsPage.HideInfoBlock";
    var customer = await workContext.GetCurrentCustomerAsync();
    var hideInfoBlock = showTour ? false : await genericAttributeService.GetAttributeAsync<bool>(customer, hideInfoBlockAttributeName);

    const string hideDisplayBlockAttributeName = "TopicDetailsPage.HideDisplayBlock";
    var hideDisplayBlock = await genericAttributeService.GetAttributeAsync<bool>(customer, hideDisplayBlockAttributeName, defaultValue: true);

    const string hideSeoBlockAttributeName = "TopicDetailsPage.HideSeoBlock";
    var hideSeoBlock = await genericAttributeService.GetAttributeAsync<bool>(customer, hideSeoBlockAttributeName, defaultValue: true);
}

<div asp-validation-summary="All"></div>
<input asp-for="Id" type="hidden" />

<section class="content">
    <div class="container-fluid">
        <div class="form-horizontal">
            <div class="row">
                <div class="col-md-12 clearfix">
                    <div class="float-left">
                        @await Component.InvokeAsync("SettingMode", new { modeName = "topic-advanced-mode" })
                    </div>
                </div>
            </div>

            <nop-cards id="topic-details-cards">
                <nop-card asp-name="topic-info" asp-icon="fas fa-info" asp-title="@T("Admin.ContentManagement.Topics.Info")" asp-hide-block-attribute-name="@hideInfoBlockAttributeName" asp-hide="@hideInfoBlock" asp-advanced="false">@await Html.PartialAsync("_CreateOrUpdate.Info", Model)</nop-card>
                <nop-card asp-name="topic-display" asp-icon="fas fa-tv" asp-title="@T("Admin.ContentManagement.Topics.Display")" asp-hide-block-attribute-name="@hideDisplayBlockAttributeName" asp-hide="@hideDisplayBlock" asp-advanced="false">@await Html.PartialAsync("_CreateOrUpdate.Display", Model)</nop-card>
                <nop-card asp-name="topic-seo" asp-icon="fas fa-search-plus" asp-title="@T("Admin.Common.SEO")" asp-hide-block-attribute-name="@hideSeoBlockAttributeName" asp-hide="@hideSeoBlock" asp-advanced="true">@await Html.PartialAsync("_CreateOrUpdate.Seo", Model)</nop-card>

                @await Component.InvokeAsync("AdminWidget", new { widgetZone = AdminWidgetZones.TopicDetailsBlock, additionalData = Model })
            </nop-cards>
        </div>
    </div>
</section>